import Vue from 'vue'
import VueRouter from 'vue-router'
//import HomeView from '../views/HomeView.vue'
import IndexView from '@/views/IndexView'
import LoginView from "@/views/LoginView";
import ContactView from "@/views/ContactView";
import JieShao from '@/views/JieShao';
import ZhiNan from '@/views/ZhiNan';
import SystemNav from '@/components/SystemNav'

import AdminRouter from './modules/Admin';
import ExpertRouter from "@/router/modules/Expert";
import UnitRouter from "@/router/modules/Unit";



Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: IndexView
  },
  {
    path: '/about',
    name: 'about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  },
  // {
  //   path: '/userList',
  //   name: 'userList',
  //   component: UserList
  // },
  {
    path: '/declare',
    name: 'declare',
    component: SystemNav,
    children: [
     //系统介绍
      {
        path: 'jieshao',
        name: 'jieshao',
        component: JieShao,

      },
      {
        path: 'zhinan',
        name: 'zhinan',
        component: ZhiNan,

      },
      //登录页面
      {
        path: 'login',
        name: 'login',
        component: LoginView
      },
      //联系页面
      {
        path: 'contact',
        name: 'contact',
        component: ContactView
      },
      //管理员路由
      AdminRouter,
      //专家路由
      ExpertRouter,
      //单位用户路由
      UnitRouter
    ]
  },
]

const router = new VueRouter({
  routes,
  mode:'history'
})

export default router
